import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/permission' // permission control
// 引入 使用 打印组件
import Print from 'vue-print-nb'
Vue.use(Print)

// import PageTools from '@/components/PageTools'
// Vue.component('PageTools', PageTools)
import PageTools from '@/components'
Vue.use(PageTools)
// 全局注册组件
import UploadImg from '@/components/UploadImg/UploadImg.vue'
Vue.component('UploadImg', UploadImg)

Vue.directive('allow', {
  inserted(el, option) {
    if (!store.state.user.userInfo.roles.points.includes(option.value)) {
      el.style.display = 'none'
    }
  }
})

import I18n from '@/lang'
Vue.use(ElementUI)

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  I18n,
  store,
  render: h => h(App)
})
